package com.bytedance.common.utility.a;

import android.annotation.TargetApi;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.os.Build;

public final class a {
    static final class a$a implements b {
        a$a() {

        }

        public final void a(Context arg2, CharSequence arg3, CharSequence arg4) {
            ((ClipboardManager)arg2.getSystemService(Context.CLIPBOARD_SERVICE)).setText(arg4);
        }
    }

    interface b {
        void a(Context arg1, CharSequence arg2, CharSequence arg3);
    }

    static final class c implements b {
        c() {

        }

        @TargetApi(value=11) public final void a(Context arg3, CharSequence arg4, CharSequence arg5) {
            ((ClipboardManager)arg3.getSystemService(Context.CLIPBOARD_SERVICE)).setPrimaryClip(ClipData.newPlainText(arg4, arg5));
        }
    }

    private static b a;

    static {
        a = Build.VERSION.SDK_INT >= 11 ? new c() : new a$a();
    }

    public static void a(Context arg1, CharSequence arg2, CharSequence arg3) {
        if(arg1 != null && arg2 != null && arg3 != null) {
            try {
                a.a(arg1, arg2, arg3);
            }
            catch(Throwable v0) {
            }
        }
    }
}

